﻿using System.Collections.Generic;
using ML.Entity;
using ML.IRepository;
using Dapper;

namespace ML.Repository
{
    public class BusinessActivitiesRepository : DBFactory, IBusinessActivitiesRepository
    {
        public IEnumerable<BusinessActivitiesEntity> GetBusinessActivitiesByMerchantId(string id)
        {
            const string sql = @"SELECT * FROM ml_businessactivities WHERE MerchantId=@MerchantId AND DelMark=0";
            using (_db)
            {
                return _db.Query<BusinessActivitiesEntity>(sql, new
                {
                    @MerchantId = id
                });
            }
        }

        public bool Add(BusinessActivitiesEntity entity)
        {
            throw new System.NotImplementedException();
        }

        public bool Delete(BusinessActivitiesEntity entity)
        {
            throw new System.NotImplementedException();
        }

        public bool Delete(string id)
        {
            throw new System.NotImplementedException();
        }

        public BusinessActivitiesEntity GetById(string id)
        {
            throw new System.NotImplementedException();
        }

        public bool Update(BusinessActivitiesEntity entity)
        {
            throw new System.NotImplementedException();
        }
    }
}